package com.ym.medical.service.impl;

import com.ym.core.utils.tkmybatis.BaseSVImpl;
import com.ym.medical.dao.VerifyExcpBillDao;
import com.ym.medical.domain.entity.VerifyExcpBillEntity;
import com.ym.medical.domain.param.VerifyExcpBillQueryParam;
import com.ym.medical.domain.param.VerifyExcpBillUpdateParam;
import com.ym.medical.domain.vo.VerifyExcpBillListPcVO;
import com.ym.medical.service.IVerifyExcpBillSV;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
                                                                                                                                                            
/**
* 对账异常账单Service业务层处理
*
* @author ym
* @date 2020-09-25
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class VerifyExcpBillSVImpl extends BaseSVImpl<VerifyExcpBillEntity,VerifyExcpBillDao> implements IVerifyExcpBillSV {

	/**
	 * 查询对账异常账单列表
	 *
	 * @param queryParam 对账异常账单 查询参数
	 * @return 对账异常账单
	 */
	@Override
	public List<VerifyExcpBillListPcVO> selectListPC(VerifyExcpBillQueryParam queryParam) {
		List<VerifyExcpBillListPcVO> verifyExcpBills = mapper.selectListPC(queryParam);
		return verifyExcpBills;
	}

	/**
	 * 新增对账异常账单
	 *
	 * @param updateParam 对账异常账单 新增参数
	 * @return 结果
	 */
	@Override
	public Long insertPC(VerifyExcpBillUpdateParam updateParam) {
            VerifyExcpBillEntity entity = updateParam.covert();
		this.insert(entity);
		return entity.getId();
	}

	/**
	 * 修改对账异常账单
	 *
	 * @param updateParam 对账异常账单 修改参数
	 * @return 结果
	 */
	@Override
	public int updateByIdPC(VerifyExcpBillUpdateParam updateParam) {
            VerifyExcpBillEntity entity = updateParam.covert("createTime");
		int result = this.updateById(entity);
		return result;
	}
}
